<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$return['basic']=$this->plugin_setting('basic');
$return['banner']=$return['basic']['hdps'];
if($_RQ['op']=='main'){
	/*******main*******/
	$return['image']=$setting['image'];
	$return['list']=array();
	exi($return);
}
if($_RQ['op']=='getlist'){	
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$return['params']=$params=array();
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>1);
	$fields=array('id','uniacid','title','status','price','createtime');
	$list=pdo_getslice('jy_tour_way',$params,array($pindex,$psize),$total,$fields,'','id desc');
	if($list){
		foreach($list as &$item){
			$images=json_decode($item['images'],true);
			$item['thumb']=$images['0'];
			$item['sellnum']=pdo_count('jy_tour_order',array('uniacid'=>$_SESSION['uniacid'],'way_id'=>$item['id'],'status >'=>'0'));
			$pingjianum=pdo_count('jy_tour_assess',array('uniacid'=>$_SESSION['uniacid'],'way_id'=>$item['id']));
			$pinjia_good=pdo_count('jy_tour_assess',array('uniacid'=>$_SESSION['uniacid'],'way_id'=>$item['id'],'star >'=>'3'));
			$item['manyidu']=number_format($pinjia_good/$pingjianum,0)*100;
		}
	}
	$return['list']=$list;
	exi($return);
}